package org.csmzxy.class2334;

public class Example02 {
    public static void modifySalary(int salary){
        salary += 1000;
    }
    public static void modifySalary(Staff staff){
        staff.salary += 1000;
    }
    public static void main(String[] args){
        Staff staff = new Staff();
        staff.name = "小王";
        staff.salary = 5000;
        System.out.println(staff.name + "的原本薪水：" + staff.salary + "元/月");
        modifySalary(staff.salary);
        System.out.println("值传递加薪：" + staff.salary + "元/月");
        modifySalary(staff);
        System.out.println("引用传递加薪：" + staff.salary + "元/月");
    }
}
